#ifndef CLIENTPLAYER_H
#define CLIENTPLAYER_H

#include "core/global.h"
#include "core/Player.h"
#include <QTcpSocket>
#include <QPoint>

class ClientPlayer : public Player{
    Q_OBJECT

public:
    ClientPlayer();

    void connectToServer(const QString &server_address, qint16 port);

public slots:
    void sendPlayerInfo();
    void chat(const QString &message);
    void movePiece(int from, int to);

private slots:
    void receiveNotification();

signals:
    void onMovePiece(int, int, int);
    void onChat(QString, QString);
    void onNewPlayer(int, QString);
    void onUpdatePlayer(int, QString);
    void onPropertyChanged(QString, QString);

    void onConnected();
    void onWin();
    void onLose();

    void occurError(QString);
};

extern ClientPlayer *Self;

#endif // CLIENTPLAYER_H
